home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / TestParts / Clock / ClckInit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  1.8 KB  |  77 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ClckInit.cpp
  3.  
  4.     Contains:    Init routines for Clock part
  5.  
  6.     Owned by:    Tantek Çelik
  7.  
  8.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     5/24/96    jpa        1246074: Call Mwerks init/terminate fns for
  13.                                     native exceptions.
  14.         <10>     11/2/95    RR        Mods for Editor swapping
  15.          <9>     9/29/95    TJ        Removed the SOMInit Routine.
  16.          <8>     8/11/95    jpa        Call InitODMemory [1276412]
  17.          <7>     5/25/95    jpa        Don't export init routines.
  18.          <6>     1/12/95    jpa        Don't use obsolete Toolbox names [1211211]
  19.          <5>    10/11/94    NP        1189812: Make Init routine pascal.
  20.          <4>     9/29/94    RA        1189812: Mods for 68K build.
  21.          <3>     8/18/94    jpa        Added prototype for SOMInit to avoid a
  22.                                     warning [1181839]
  23.          <2>     8/17/94    CG        #1181487:  Call ClockNewClass to
  24.                                     instantiate  Clock by name.
  25.          <1>     7/28/94    TÇ        first checked in
  26.     To Do:
  27.     In Progress:
  28.  
  29. */
  30.  
  31.  
  32. #include <som.xh>
  33. #include <somobj.xh>
  34.  
  35. #ifndef _USERSRCM_
  36. #include <UseRsrcM.h>
  37. #endif
  38.  
  39. #ifndef _ODMEMORY_
  40. #include <ODMemory.h>
  41. #endif
  42.  
  43. #ifndef SOM_AppleTest_Clock_xh
  44. #include "Clock.xh"
  45. #endif
  46.  
  47.  
  48. #ifdef __MWERKS__
  49. extern "C" {
  50.     void __initialize();        // From Metrowerks runtime library, Startup.c
  51.     void __terminate();
  52. }
  53. #endif
  54.  
  55.  
  56. extern "C" pascal OSErr ClockCFMInit (CFragInitBlockPtr initBlkPtr);
  57. extern "C" pascal void  ClockCFMTerminate( );
  58.  
  59. pascal OSErr ClockCFMInit (CFragInitBlockPtr initBlkPtr)
  60. {
  61. #ifdef __MWERKS__
  62.     __initialize();        // Initialize static data and construct any global objects
  63. #endif
  64.     somNewClass(AppleTest_Clock);
  65.     OSErr err;
  66.     if( (err=InitODMemory()) != noErr ) return err;
  67.     return InitLibraryResources(initBlkPtr);
  68. }
  69.  
  70. pascal void ClockCFMTerminate( )
  71. {
  72.     CloseLibraryResources();
  73. #ifdef __MWERKS__
  74.     __terminate();        // Destruct static objects & clean up exception tables
  75. #endif
  76. }
  77.